package com.hyz.dto;

import com.hyz.entity.Comment;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author HGD
 * @date 2023/2/12 0:49
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ListResult {
    private Integer statusCode;
    private String statusMsg;
    private List<Comment> commentList;

    public static ListResult ok(List<Comment> commentList) {
        return new ListResult(0, "", commentList);
    }

    public static ListResult ok(String statusMsg, List<Comment> commentList) {
        return new ListResult(0, statusMsg, commentList);
    }

    public static ListResult fail() {
        return new ListResult(0, "", null);
    }

    public static ListResult fail(String statusMsg) {
        return new ListResult(0, statusMsg, null);
    }
}
